{{define "Title"}}按物料查询{{end}}
{{define "Content"}}

<script type=text/javascript src="/js/tablestyle.js"></script>

<div class="container-fluid">
<form class="form-horizontal" action="/queryitem" method="POST">
  <fieldset>
    <legend><b>按物料查询</b></legend>
    <div class="control-group">
      <label class="control-label">物料&nbsp;</label>
      <div class="control">
        <input type="text" class="input-large" id="item" name="item" style="font-weight: bold; text-transform:uppercase; background-color: #FFFFD0;" maxlength="30"> <b style="color: red">*</b>
      </div>
    </div>
    <div class="form-actions">
      <button type="submit" class="btn btn-primary">查询</button>
    </div>
  </fieldset>
</form>
</div>

{{if .items}}
<div class="content-box">
  <div class="content-box-header">
    <p style="font-size: 16px;">&nbsp;&nbsp;<b>物料明细</b></p>
  </div>
  <div class="content-box-content">
    <table id="tbl_ls" border="1" cellspacing="0" cellpadding="0">
      <thead>
        <tr>
          <th>物料</th>
          <th>描述</th>
          <th>频段</th>
          {{if eq .ProductionLine "SFPRD06"}}
            <th>包装数量</th>
          {{else}}
            <th>指标</th>
          {{end}}
          <th>制程</th>
          <th>类型</th>
          <th>产品代码</th>
          <th>产品工厂代码</th>
          <th>是否锁定</th>
        </tr>
      </thead>
      <tbody id="group_one">
      <tr>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" width="120">{{.items.Item | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" width="300">{{.items.Desc | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" width="100">{{.items.Band | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" width="100">{{.items.Limit | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" width="180"><a href="/routing?q={{.items.Route | html}}" target="_blank">{{.items.Route | html}}</a></td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" align="center" width="50">{{.items.PrdType | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" align="center" width="50">{{.items.PrdCode | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" width="50">{{.items.FacCode | html}}</td>
        <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" align="center" width="50">{{.items.Locked | html}}</td>
      </tr>
    </tbody>
    </table>
  </span>
  </div>
  </div>
{{end}}

{{if .testinfo}}
<div class="content-box">
  <div class="content-box-header">
    <p style="font-size: 16px;">&nbsp;&nbsp;<b>物料测试明细</b></p>
  </div>
  <div class="content-box-content">
    <table id="tbl_ls" border="1" cellspacing="0" cellpadding="0">
      <thead>
        <tr>
          <th>物料</th>
          <th>打印名称</th>
          <th>测试名称</th>
          <th>频段(MHz)</th>
          <th>端口</th>
          <th>指标</th>
        </tr>  
      </thead>    
      
      <tbody>
        {{range .testinfo}}
        <tr>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px" align="center">{{.Item | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Parameter | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.TestName | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Frequency | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Ports | html}}</td>
          <td fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Specification | html}}</td>
        </tr>
        {{end}}
      </tbody>
      
    </table>
  </div>
</div>

{{end}}

{{if .wo_details}}
<div class="content-box">
  <div class="content-box-header">
    <p style="font-size: 16px;">&nbsp;&nbsp;<b>工单信息</b></p>
  </div>
<div class="content-box-content">
<table id="tbl_ls" border="1" cellspacing="0" cellpadding="0">
  <thead>
    <tr>
      <th>索引</th>
      <th>工单</th>
      <th>物料</th>
      <th>版本</th>
      <th>数量</th>
      <th>制程</th>
      <th>发布</th>
      <th>发布数量</th>
      <th>关闭</th>
      <th>锁定</th>
    </tr>
  </thead>
  <tbody id="group_one">
  {{range .wo_details}}
  <tr>
    <td id="order_idx" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Index | html}}</td>
    <td id="order_won" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px"><a href="/querywo?q={{.Wono | html}}">{{.Wono | html}}</a></td>
    <td id="order_itm" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Item | html}}</td>
    <td id="order_ver" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Version | html}}</td>
    <td id="order_qty" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Qty | html}}</td>
    <td id="order_rot" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Route | html}}</td>
    <td id="order_rel" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Released | html}}</td>
    <td id="order_rqt" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.ReleasedQty | html}}</td>
    <td id="order_cls" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Closed | html}}</td>
    <td id="order_lck" fieldset style="color: #666666; border-style: groove; font-weight: bold; font-size: 14px">{{.Locked | html}}</td>
  </tr>
  {{end}}
  </tbody>
</table>
</span>
</div>
</div>
{{end}}

{{end}}